<template>
  <div>
    <barCommod v-if="barShow" class="bar"/>
    <div class="head">
      <div class="logo">
        <img src="../assets/images/logo.png" alt="">
      </div>
      <div class="menu">
        <ul>
          <li class="active">首页</li>
          <li>关于我们</li>
          <li @click="$router.push('/product')">产品</li>
          <li>查价</li>
          <li style="color: #fff;">
            <i class="el-icon-search"></i>
          </li>
        </ul>
        <img @click="barShow = !barShow" class="show-bar" src="../assets/images/menu.png" alt="">
      </div>
    </div>
  </div>
</template>

<script>
import barCommod from './Bar'
export default {
  name: 'Header',
  data () {
    return {
      barShow: false,
    }
  },
  components: {
    barCommod
  }
}
</script>

<style scoped>
  .head {
    width: 80%;
    margin-left: 10%;
  }

  .bar {
    top: 80px;
  }

  .logo {
    float: left;
    width: 130px;
    margin-top: 20px;
  }

  .logo img {
    max-width: 100%;
  }

  .menu {
    float: right;
    /*background: url("../assets/images/menu.png") no-repeat right center;*/
    line-height: 60px;
  }

  .menu ul {
    float: left;
  }

  .show-bar {
    float: right;
    margin-top: 10px;
    margin-left: 45px;
    cursor: pointer;
  }

  .menu li {
    float: left;
    list-style: none;
    color: #fff;
    margin: 0 40px;
    cursor: pointer;
    font-size: 18px;
  }

  .menu li.active {
    border-bottom: 2px solid #fff;
  }
</style>
